home *** CD-ROM | disk | FTP | other *** search
- From: ChrisHines@msn.com (Chris Hines)
- Subject: Re: What are the differences between structures and classes in C++ ?
- Date: 11 Apr 96 05:32:17 -0700
- References: <4k5m65$av@hpscit.sc.hp.com> <DpG53J.Hsz@presby.edu> <4k83j3$a56@hpscit.sc.hp.com> <marnoldDpHvED.E0t@netcom.com> <31696B8E.6461@datalytics.com> <3169F3F5.4D@tarley_pc.loc201.tandem.com>
- Message-ID: <00001a81+0000b1d5@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
- >Rob Stewart wrote:
- >>
- >> Actually, classes *are* structs, since struct came first. Early
- >> debuggers would also reveal this (at least dbx on the UNIX side
- >> did). What you declared a class the debugger revealed as a
- >> struct.
- >
- >Nope. Structs *are* classes since classes include all features of
- >structs _and_ additional functionality. And the fact that early
- >debuggers carry some rudimentary naming conventions only points
- >out that they were created in a hurry or by people who were too
- >lazy to do appropriate changes.
- >
- >Regards,
- >
- >Anatoli.
-
- From Stroustrup's "The C++ Programming Language" page 542: A
- structure is a class declared with the class-key struct; its members
- and base classes are public by default.
-
- In other words a class and a struct are identical except for the
- default accessibility of it's members. I'm not aware of any features
- that classes have that structs lack.
-
- ------
- Chris Hines ChrisHines@msn.com
-